package cn.zeal4j.util;


import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;

/**
 * @author Administrator
 * @file IntelliJ IDEA Spring-Mail
 * @create 2020 09 22 12:08
 */
public class EmailAuthenticator extends Authenticator {

    private String username;
    private String password;

    public EmailAuthenticator(String username, String password) {
        this.username = username;
        this.password = password;
    }

    @Override
    protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(username, password);
    }
}
